package parser.symbol;


public class MyNumber extends Symbol {
    protected int value;

    /**
     * 认为表达式中单独的一个数字，比如2+3中的2是
     * MyNumber const，value=2.i32，没有addr，没有name和id
     *
     * @param value
     */
    public MyNumber(int value) {
        super();
        this.value = value;
        this.setConst(true);
        this.setType("i32");
    }

    public MyNumber(String addr,int value) {
        super();
        this.setAddress(addr);
        this.value = value;
        this.setConst(true);
        this.setType("i32");
    }

    public void setValue(int value) {
        this.value = value;
    }

    public int getValue() {
        return value;
    }

    @Override
    public String toString() {
        return "MyNumber{" +
                "value=" + value +
                ", type='" + type + '\'' +
                ", isGlobal=" + isGlobal +
                ", address='" + address + '\'' +
                ", blockId=" + blockId +
                "}\n";
    }
}
